﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;
using System.Globalization;
using System.Windows.Media;

namespace ReporterControlLibrary.Converters
{
    [ValueConversion(typeof(MessageBoxButton), typeof(Visibility))]
    public class ButtonToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            var currentState = value.ToString(); 
            var states = (string[])parameter;

            if (states.Contains(currentState))
                return Visibility.Visible;
            else
                return Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
